﻿using System;

namespace HelfenHelfen.Web.Forms.Site
{
    public partial class Default : System.Web.UI.Page
    {
        protected void btnSearch_Click(object sender, EventArgs e)
        {
            DateTime date = default(DateTime);
            
            Session["Search_City"] = ddlCity.Text.StartsWith("(Alle") ? String.Empty : ddlCity.Text;
            Session["Search_Category"] = ddlCategory.Text.StartsWith("(Alle") ? Guid.Empty : Guid.ParseExact(ddlCategory.SelectedValue, "D");
            if (DateTime.TryParse(txtDate.Text, out date))
            {
                Session["Search_Date"] = date;
            }
            else
            {
                Session["Search_Date"] = null;
            }

            Response.Redirect("~/ProjList.aspx");
        }
    }
}